namespace VisionarySystems.TimeRegi.Model.TimePeriods
{
    public class TimePeriodeID 
    {
        #region Constructor 

        public TimePeriodeID(int SubID, TimePeriodeType Type)
        {
            this.Type = Type;
            this.SubID = SubID;
        }

        #endregion

        #region Properties

        public TimePeriodeType Type { get; private set; }
        public int SubID { get; private set; }

        #endregion

        #region Public methods

        public override string ToString()
        {
            return string.Format("Type: {0}, SubID: {1}", Type, SubID);
        }

        public override bool Equals(System.Object obj)
        {
            // If parameter is null return false.
            if (obj == null)
            {
                return false;
            }

            // If parameter cannot be cast to Point return false.
            TimePeriodeID p = obj as TimePeriodeID;
            if ((System.Object)p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return (Type == p.Type) && (SubID == p.SubID);
        }

        public bool Equals(TimePeriodeID p)
        {
            // If parameter is null return false:
            if ((object)p == null)
            {
                return false;
            }

            // Return true if the fields match:
            return (Type == p.Type) && (SubID == p.SubID);
        }

        #endregion

    }
}